<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch" data-options="{searchDatagrid:$.CurrentNavtab.find('#roles')}">
        <fieldset>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>角色名称：</span>
                <input type="text" name="name" class="form-control" size="15">
                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
                    <button type="reset" class="btn-orange" data-icon="times">重置</button>
                </div>
            </div>
        </fieldset>
    </form>
</div>

<div class="bjui-pageContent">
    <table class="table table-bordered" id="roles" data-toggle="datagrid" data-options="{
        height: '100%',
        local: 'remote',
        showToolbar: true,
        toolbarItem: 'add, edit, del',
        dataUrl: '/sysmanage/roles/listdata.do',
        editMode: {dialog:{width:'800',height:500,mask:true,title:'编辑'}},
        editUrl: '/sysmanage/roles/add.do?{id}',
        delUrl :'/sysmanage/roles/del.do',
        paging: {pageSize:20, pageCurrent:1},
        linenumberAll: false,
        filterThead:false,
        sortAll: true
    }">
        <thead>
        <tr>
            <th data-options="{name:'id',align:'center' }" width="100px">id</th>
            <th data-options="{name:'name',align:'center'}" width="140px">角色名称</th>
            <th data-options="{name:'memo',align:'center'}" width="200px">备注</th>
            <th data-options="{render:roleright,align:'center'}" width="100px">操作列</th>
        </tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function roleright() {
        var dig_product = '<button onClick="TolinkEdit($(this))" class="btn-green">权限分配</button>'
        return dig_product;
    }
    function TolinkEdit(a) {
        var objtrId = a.parent().parent().parent();
        $("#roles").datagrid('externalEdit',
                objtrId, {
                    navtab: {
                        id: "rolesright",
                        url: "/sysmanage/sysmodule/list.do?id={id}",
                        max: true,
                        title: '权限分配',
                        onClose: function () {
                            BJUI.navtab('refresh', 'sysrole')
                        }
                    }
                });
    }
</script>